package com.design.pattern.command.projection4;

import java.util.Arrays;
import java.util.List;

public class Client {
    public static void main(String[] args) {
        //先生成执行者集合
        List<CommandExecutor> executors = Arrays.asList(
                new ConcreteCommandExcutor("a"),
                new ConcreteCommandExcutor("b"),
                new ConcreteCommandExcutor("c"),
                new ConcreteCommandExcutor("d")
        );
        //生成命令
        Command command=new Command().setExecutors(executors).setContent("广播体操");
        //定义发送人,并发出命令
        CommandSender commandSender=new ConcreteCommandSender(new ConcretetCommandChannel());
        commandSender.send(command);
    }
}
